﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DataBaseTable;
public partial class Manage_Gobal_Web : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Master.WebPath += "&nbsp;-&nbsp;&nbsp; 网站信息设置";
            DataBd();
        }
    }
    protected void DataBd()
    {
        WebTable wt = new WebTable();
        this.WebName.Text = wt.WebName;
        this.Keyword.Text = wt.Keyword;
        this.Description.Text = wt.Description;
        this.BeiAn.Text = wt.BeiAn;
        this.Email.Text = wt.Email;
        this.BottomText.Text = wt.BottomText;
        this.OutHits.Text = wt.OutHits;
        this.Address.Text = wt.Address;
        this.Phone.Text = wt.Phone;
    }
    protected void Submit_Click(object sender, EventArgs e)
    {
        WebTable wt = new WebTable();
        wt.WebName = this.WebName.Text;
        wt.Keyword = this.Keyword.Text;
        wt.Description = this.Description.Text;
        wt.BeiAn = this.BeiAn.Text;
        wt.Email = this.Email.Text;
        wt.BottomText = this.BottomText.Text;
        wt.Phone = this.Phone.Text;
        wt.OutHits = this.OutHits.Text;
        wt.Address = this.Address.Text;
        try
        {
            wt.Update();
            ClientScript.RegisterStartupScript(GetType(), "message", "<script>alert('更新成功');</script>");
            DataBd();
        }
        catch
        {
            ClientScript.RegisterStartupScript(GetType(), "message", "<script>alert('更新失败');</script>");
        }
    }
}